package com.rfid.assistant.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.rfid.assistant.BluetoothManager;
import com.rfid.assistant.R;
import com.rfid.assistant.activity.adapter.FunctionHomeAdapter;
import com.rfid.assistant.activity.adapter.OnItemClickListener;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class BluetoothHomeActivity extends Activity implements OnItemClickListener {

    @BindView(R.id.recyclerView)
    RecyclerView mRecyclerView;
    FunctionHomeAdapter mAdapter;


    public static void startActivity(Context context) {
        Intent intent = new Intent();
        intent.setClass(context, BluetoothHomeActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ble_function_home_layout);
        ButterKnife.bind(this);
        List<String> data = new ArrayList<>();
        data.add("配置");
        mAdapter = new FunctionHomeAdapter(data);
        mAdapter.setListener(this);
        mRecyclerView.setLayoutManager(new GridLayoutManager(this,2));
        mRecyclerView.setAdapter(mAdapter);
    }

    @Override
    public void onClick(int pos) {
//        ConfigActivity.startActivity(this);
        SafeDoorConfigActivity.startActivity(this, BluetoothManager.INSTANCE.getMac(),true,false);
    }

}
